package com.zijie.system.mapper;

import com.zijie.common.mybatis.core.mapper.BaseMapperPlus;
import com.zijie.system.domain.entity.SysUserRole;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

/**
 * 用户与角色关联表 数据层
 *
 * @author Lion Li
 */
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole, SysUserRole> {

    List<Long> selectUserIdsByRoleId(Long roleId);

    @Insert("insert into sys_user_role(user_id, role_id) values(#{userId}, #{roleId})")
    int insertUserRole(Long userId, Long roleId);
}
